import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect:"home"
    },
    {
      path: '/home',
      name: '/home',
      component: () => import("../view/home/home")
    },
    {
      path: '/user',
      name: '/user',
      component: () => import("../view/user/user")
    },
    {
      path: '/personCenter',
      name: '/personCenter',
      component: () => import("../components/personalCenter/personalCenter")
    },
    {
      path: '/login',
      name: '/login',
      component: () => import("../view/login/login")
    },
    {
      path: '/bookBorrow',
      name: '/bookBorrow',
      component: () => import("../view/bookBorrow/bookBorrow")
    },
    {
      path: '/administrator',
      name: '/administrator',
      component: () => import("../view/administrator/administrator"),
      children:[
        {
          path: '/addForm',
          name: '/addForm',
          component: () => import("../view/administrator/addForm")
        },{
          path: '/userList',
          name: '/userList',
          component: () => import("../view/administrator/userList/userList")
        },
        {
          path: '/bookList',
          name: '/bookList',
          component: () => import("../view/administrator/bookList/bookList")
        },
        {
          path: '/adminList',
          name: '/adminList',
          component: () => import("../view/administrator/adminList/adminList")
        }
      ]
    }

  ]
})
